<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>卡牌对战游戏</title>
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
    <style>
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
            font-family: 'Orbitron', 'Microsoft YaHei', sans-serif;
        }
        
        body {
            min-height: 100vh;
            color: white;
            overflow-x: hidden;
        }
        
        /* 视频背景容器 */
        #video-container {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            z-index: -1;
            overflow: hidden;
        }
        
        #bg-video {
            position: absolute;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%);
            min-width: 100%;
            min-height: 100%;
            width: auto;
            height: auto;
            object-fit: cover;
            filter: brightness(1.5) blur(2px);
        }
        
        /* 内容覆盖层 */
        .content-overlay {
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: rgba(0, 0, 20, 0.85);
        }
        
        .container {
            max-width: 1200px;
            margin: 0 auto;
            padding: 20px;
            position: relative;
            z-index: 1;
        }
        
        .header {
            text-align: center;
            margin-bottom: 30px;
            position: relative;
            padding: 20px 0;
        }
        
        .header h1 {
            font-size: 3.5rem;
            margin-bottom: 15px;
            text-shadow: 0 0 15px #00f7ff;
            letter-spacing: 3px;
            position: relative;
            display: inline-block;
            background: linear-gradient(90deg, #00f7ff, #ff00ff);
            -webkit-background-clip: text;
            -webkit-text-fill-color: transparent;
            animation: title-glow 3s infinite alternate;
        }
        
        .header p {
            font-size: 1.2rem;
            color: #aaa;
            max-width: 600px;
            margin: 0 auto;
            line-height: 1.6;
            text-shadow: 0 0 5px rgba(0, 0, 0, 0.7);
        }
        
        /* 房间系统样式 */
        .room-container {
            background: rgba(20, 20, 40, 0.7);
            border-radius: 15px;
            padding: 30px;
            box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5), 0 0 0 2px #0066ff, 0 0 15px rgba(0, 102, 255, 0.5);
            max-width: 700px;
            margin: 0 auto;
            position: relative;
            overflow: hidden;
            backdrop-filter: blur(5px);
        }
        
        .room-container::before {
            content: "";
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background: 
                linear-gradient(90deg, transparent 0%, rgba(0, 247, 255, 0.1) 50%, transparent 100%),
                repeating-linear-gradient(45deg, transparent, transparent 10px, rgba(0, 247, 255, 0.1) 10px, rgba(0, 247, 255, 0.1) 20px);
            pointer-events: none;
            animation: scan 8s linear infinite;
        }
        
        .room-container h2 {
            text-align: center;
            margin-bottom: 25px;
            font-size: 2rem;
            color: #00f7ff;
            text-shadow: 0 0 10px #00f7ff;
        }
        
        .room-selection {
            display: flex;
            flex-direction: column;
            gap: 25px;
        }
        
        #create-room {
            padding: 15px 30px;
            font-size: 1.2rem;
            background: linear-gradient(45deg, #0066ff, #00f7ff);
            border: none;
            border-radius: 50px;
            color: white;
            cursor: pointer;
            transition: all 0.3s ease;
            box-shadow: 0 0 15px #0066ff;
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 10px;
            letter-spacing: 1px;
        }
        
        #create-room:hover {
            transform: translateY(-3px);
            box-shadow: 0 0 25px #00f7ff;
            background: linear-gradient(45deg, #00aaff, #00ffff);
        }
        
        .room-input {
            display: flex;
            gap: 10px;
        }
        
        .room-query {
            display: flex;
            gap: 10px;
            margin-top: 15px;
        }
        
        .room-input input,
        .room-query input {
            flex: 1;
            padding: 15px 20px;
            border: 2px solid #00f7ff;
            border-radius: 50px;
            background: rgba(10, 10, 30, 0.7);
            color: white;
            font-size: 1rem;
            box-shadow: 0 0 10px rgba(0, 247, 255, 0.5);
        }
        
        .room-input input::placeholder,
        .room-query input::placeholder {
            color: rgba(255, 255, 255, 0.6);
        }
        
        .room-input input:focus,
        .room-query input:focus {
            outline: none;
            border-color: #ff00ff;
            box-shadow: 0 0 15px #ff00ff;
        }
        
        #join-room,
        #query-room {
            padding: 15px 25px;
            background: linear-gradient(45deg, #ff00ff, #cc00ff);
            border: none;
            border-radius: 50px;
            color: white;
            cursor: pointer;
            transition: all 0.3s ease;
            box-shadow: 0 0 15px rgba(255, 0, 255, 0.5);
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 8px;
            letter-spacing: 1px;
        }
        
        #join-room:hover,
        #query-room:hover {
            transform: translateY(-3px);
            box-shadow: 0 0 25px #ff00ff;
            background: linear-gradient(45deg, #ff33ff, #dd00dd);
        }
        
        #list-rooms {
            padding: 15px 30px;
            font-size: 1.1rem;
            background: linear-gradient(45deg, #00ff88, #00cc66);
            border: none;
            border-radius: 50px;
            color: white;
            cursor: pointer;
            transition: all 0.3s ease;
            box-shadow: 0 0 15px rgba(0, 255, 136, 0.5);
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 10px;
            letter-spacing: 1px;
            margin-top: 15px;
        }
        
        #list-rooms:hover {
            transform: translateY(-3px);
            box-shadow: 0 0 25px #00ff88;
            background: linear-gradient(45deg, #33ffaa, #00dd88);
        }
        
        #room-info {
            margin-top: 20px;
            padding: 20px;
            background: rgba(0, 247, 255, 0.1);
            border-radius: 10px;
            border: 1px solid #00f7ff;
        }
        
        #room-info p {
            margin: 10px 0;
            font-size: 16px;
            color: #00f7ff;
            text-shadow: 0 0 5px #00f7ff;
        }
        
        #room-actions {
            display: flex;
            gap: 10px;
            justify-content: center;
            margin-top: 15px;
        }
        
        #room-actions button {
            padding: 10px 20px;
            border: none;
            border-radius: 25px;
            background: linear-gradient(45deg, #00f7ff, #0066ff);
            color: white;
            cursor: pointer;
            transition: all 0.3s ease;
            box-shadow: 0 0 10px rgba(0, 247, 255, 0.5);
        }
        
        #room-actions button:hover {
            transform: translateY(-2px);
            box-shadow: 0 0 15px #00f7ff;
        }
        
        /* 游戏容器样式 */
        .game-container {
            max-width: 1200px;
            margin: 0 auto;
            padding: 20px;
            background: rgba(20, 20, 40, 0.8);
            border-radius: 15px;
            box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5), 0 0 0 2px #00f7ff, 0 0 15px rgba(0, 247, 255, 0.3);
            backdrop-filter: blur(5px);
        }
        
        /* 玩家信息样式 */
        .player-info {
            background: rgba(16, 16, 32, 0.8);
            border-radius: 10px;
            padding: 15px;
            margin-bottom: 20px;
            box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3), 0 0 0 1px #00f7ff, 0 0 10px rgba(0, 247, 255, 0.2);
            border: 1px solid #00f7ff;
        }
        
        .player-stats {
            display: flex;
            justify-content: space-around;
            margin-bottom: 15px;
            font-size: 18px;
            color: #00f7ff;
            text-shadow: 0 0 5px #00f7ff;
        }
        
        /* 战斗区域样式 */
        .battle-area {
            display: flex;
            gap: 10px;
            min-height: 150px;
            padding: 10px;
            background: rgba(0, 247, 255, 0.1);
            border-radius: 5px;
            margin-bottom: 15px;
            border: 1px dashed #00f7ff;
            box-shadow: 0 0 10px rgba(0, 247, 255, 0.2);
        }
        
        /* 手牌区域样式 */
        .hand-area {
            display: flex;
            gap: 10px;
            min-height: 120px;
            padding: 10px;
            background: rgba(255, 0, 255, 0.1);
            border-radius: 5px;
            border: 1px dashed #ff00ff;
            box-shadow: 0 0 10px rgba(255, 0, 255, 0.2);
        }
        
        /* 游戏控制区域样式 */
        .game-controls {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 15px;
            background: rgba(16, 16, 32, 0.8);
            border-radius: 10px;
            margin: 20px 0;
            box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3), 0 0 0 1px #00f7ff, 0 0 10px rgba(0, 247, 255, 0.2);
            border: 1px solid #00f7ff;
        }
        
        .timer, .round {
            font-size: 18px;
            font-weight: bold;
            color: #00f7ff;
            text-shadow: 0 0 5px #00f7ff;
        }
        
        #refresh-cards, #upgrade {
            padding: 10px 20px;
            border: none;
            border-radius: 25px;
            background: linear-gradient(45deg, #00f7ff, #0066ff);
            color: white;
            cursor: pointer;
            transition: all 0.3s ease;
            box-shadow: 0 0 10px rgba(0, 247, 255, 0.5);
        }
        
        #refresh-cards:hover, #upgrade:hover {
            transform: translateY(-2px);
            box-shadow: 0 0 15px #00f7ff;
        }
       /* 可用卡牌区域样式 */
        .available-cards {
            display: flex;
            gap: 10px;
            padding: 15px;
            background: rgba(16, 16, 32, 0.8);
            border-radius: 10px;
            box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3), 0 0 0 1px #00f7ff, 0 0 10px rgba(0, 247, 255, 0.2);
            border: 1px solid #00f7ff;
            flex-wrap: wrap;
        }
        
        /* 卡牌样式 */
        .card {
            width: 100px;
            height: 150px;
            background: rgba(255, 255, 255, 0.1);
            border: 1px solid #00f7ff;
            border-radius: 5px;
            padding: 10px;
            cursor: pointer;
            transition: all 0.3s ease;
            position: relative;
            box-shadow: 0 0 10px rgba(0, 247, 255, 0.3);
        }
        
        .card:hover {
            transform: translateY(-5px);
            box-shadow: 0 0 20px #00f7ff;
        }
        
        .card img {
            width: 100%;
            height: 100%;
            object-fit: contain;
        }
        
        /* 合成特效 */
        .merged-card {
            animation: mergeEffect 1s ease-in-out;
            box-shadow: 0 0 20px #ff00ff;
        }
        
        @keyframes mergeEffect {
            0% {
                transform: scale(1);
            }
            50% {
                transform: scale(1.2);
            }
            100% {
                transform: scale(1);
            }
        }
        
        @keyframes title-glow {
            0% {
                text-shadow: 0 0 15px #00f7ff;
            }
            100% {
                text-shadow: 0 0 25px #ff00ff, 0 0 35px #00f7ff;
            }
        }
        
        @keyframes scan {
            0% {
                background-position: 0 0;
            }
            100% {
                background-position: 100% 100%;
            }
        }
        
        /* 响应式设计 */
        @media (max-width: 768px) {
            .game-container {
                padding: 10px;
            }
            
            .player-stats {
                flex-direction: column;
                align-items: center;
                gap: 10px;
            }
            
            .game-controls {
                flex-direction: column;
                gap: 10px;
            }
            
            .card {
                width: 80px;
                height: 120px;
            }
            
            .header h1 {
                font-size: 2.5rem;
            }
            
            .room-input,
            .room-query {
                flex-direction: column;
                gap: 10px;
            }
            
            .room-item {
                flex-direction: column;
                align-items: flex-start;
                gap: 10px;
            }
            
            .room-item-join {
                align-self: flex-end;
            }
        }
        
        #room-query-result,
        #room-list {
            margin-top: 20px;
            padding: 20px;
            background: rgba(0, 247, 255, 0.1);
            border-radius: 10px;
            border: 1px solid #00f7ff;
        }
        
        #room-query-result h3,
        #room-list h3 {
            color: #00f7ff;
            margin-bottom: 15px;
            text-shadow: 0 0 10px #00f7ff;
        }
        
        .room-item {
            background: rgba(16, 16, 32, 0.8);
            border: 1px solid #00f7ff;
            border-radius: 8px;
            padding: 15px;
            margin-bottom: 10px;
            display: flex;
            justify-content: space-between;
            align-items: center;
            transition: all 0.3s ease;
        }
        
        .room-item:hover {
            box-shadow: 0 0 15px rgba(0, 247, 255, 0.5);
            transform: translateY(-2px);
        }
        
        .room-item-info {
            flex: 1;
        }
        
        .room-item-id {
            font-size: 1.1rem;
            font-weight: bold;
            color: #00f7ff;
            margin-bottom: 5px;
        }
        
        .room-item-status {
            font-size: 0.9rem;
            color: #aaa;
        }
        
        .room-item-players {
            font-size: 0.9rem;
            color: #00ff88;
        }
        
        .room-item-join {
            padding: 8px 15px;
            background: linear-gradient(45deg, #00f7ff, #0066ff);
            border: none;
            border-radius: 20px;
            color: white;
            cursor: pointer;
            transition: all 0.3s ease;
            font-size: 0.9rem;
        }
        
        .room-item-join:hover {
            transform: translateY(-2px);
            box-shadow: 0 0 10px #00f7ff;
        }
        
        .status-waiting {
            color: #ffff44 !important;
        }
        
        .status-playing {
            color: #ff4444 !important;
        }
    </style>
</head>
<body>
    <!-- 视频背景 -->
    <div id="video-container">
        <video id="bg-video" autoplay muted loop>
            <source src="2.mp4" type="video/mp4">
        </video>
        <div class="content-overlay"></div>
    </div>

    <div class="container">
        <div class="header">
            <h1>卡牌对战游戏</h1>
            <p>与朋友一起体验紧张刺激的卡牌对战，策略与运气的完美结合</p>
        </div>

        <div id="room-container" class="room-container">
            <h2>房间系统</h2>
            <div id="room-selection" class="room-selection">
                <button id="create-room">
                    <i class="fas fa-plus-circle"></i>
                    创建房间
                </button>
                <div class="room-input">
                    <input type="text" id="room-input" placeholder="输入房间ID">
                    <button id="join-room">
                        <i class="fas fa-sign-in-alt"></i>
                        进入房间
                    </button>
                </div>
                <div class="room-query">
                    <input type="text" id="room-query-input" placeholder="查询房间ID">
                    <button id="query-room">
                        <i class="fas fa-search"></i>
                        查询房间
                    </button>
                </div>
                <button id="list-rooms">
                    <i class="fas fa-list"></i>
                    查看所有房间
                </button>
            </div>
            <div id="room-info" style="display: none;">
                <p>房间ID: <span id="room-id">等待连接...</span></p>
                <p>状态: <span id="room-status">等待连接...</span></p>
                <div id="room-actions">
                    <button id="copy-room-id">
                        <i class="fas fa-copy"></i>
                        复制房间ID
                    </button>
                    <button id="share-room">
                        <i class="fas fa-share"></i>
                        分享房间
                    </button>
                </div>
            </div>
            <div id="room-query-result" style="display: none;">
                <h3>查询结果</h3>
                <div id="query-result-content"></div>
            </div>
            <div id="room-list" style="display: none;">
                <h3>房间列表</h3>
                <div id="room-list-content"></div>
            </div>
        </div>

        <div id="game-container" class="game-container" style="display: none;">
            <div id="opponent-info" class="player-info">
                <div class="player-stats">
                    <span>等级: <span id="opponent-level">1</span></span>
                    <span>金币: <span id="opponent-gold">100</span></span>
                    <span>生命值: <span id="opponent-health">30</span></span>
                </div>
                <div id="opponent-battle" class="battle-area"></div>
                <div id="opponent-hand" class="hand-area"></div>
                <div id="opponent-bonds" class="bonds"></div>
            </div>

            <div id="game-controls" class="game-controls">
                <div class="timer">回合时间: <span id="timer">20</span>秒</div>
                <div class="round">回合: <span id="round">1</span></div>
                <button id="refresh-cards">
                    <i class="fas fa-sync-alt"></i>
                    刷新卡牌 (2金币)
                </button>
                <button id="upgrade">
                    <i class="fas fa-arrow-up"></i>
                    升级 (5金币)
                </button>
            </div>

            <div id="player-info" class="player-info">
                <div class="player-stats">
                    <span>等级: <span id="player-level">1</span></span>
                    <span>金币: <span id="player-gold">100</span></span>
                    <span>生命值: <span id="player-health">30</span></span>
                </div>
                <div id="player-battle" class="battle-area"></div>
                <div id="player-hand" class="hand-area"></div>
                <div id="player-bonds" class="bonds"></div>
            </div>

            <div id="available-cards" class="available-cards"></div>
        </div>
    </div>

    <script src="cardConfig.js"></script>
    <script src="script.js"></script>
</body>
</html>